﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LeadCRM.Entities;


namespace LeadCRM.API
{
    public class UserMgr
    {
        public void RegisterUser(User user)
        {

        }

        public List<User> GetAllUser(int PageSize = 10,int PageNo = 0)
        {
            LeadCRMContext db = new LeadCRMContext();
            List<User> UserList = (from p in db.User
                                  where p.IsApproved == true 
                                  where p.IsLockedOut == false 
                                  select p).OrderBy(b=>b.Username).Skip(PageNo*PageSize).Take(PageSize)
                                  .ToList();

            return UserList;
        }

        public void ModifyUser(User user)
        {

        }

        public void InactivateUser(User user)
        {

        }

    }
}